package com.yeyouluo.zk;

import org.I0Itec.zkclient.ZkClient;

public class DisClient {

    String beforNodePath;
    String currentNoePath;
    private ZkClient zkClient = new ZkClient("linux121:2181,linux122:2181");


    /**
     * 获取锁
     */
    public void getDisLock() {
        synchronized (DisClient.class){
            if (!zkClient.exists("/distrilock")) {
                zkClient.createPersistent("/distrilock");
            }
        }
    }

    /**
     * 释放锁
     */
    public void deleteLock() {
    }
}
